<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of DBAccess
 *
 * @author user
 */
class DBAccess {
    
        private $host="localhost";
        private $user="root";
        private $password="root";
        private $connectDBServer;
        private $connectDB;
        private $dbName="gradebay";
        
        
        //DB Access Constructor
        function __construct() {
            //connect
            $this->DBConnect();
        }

       //Database Connection
        public function DBConnect(){
            //Start Database Connection
             $this->connectDBServer=mysql_connect($this->host, $this->user, $this->password);
             
            //Select Database
             $this->connectDB=mysql_select_db($this->dbName,$this->connectDBServer);
             
              
             if (!$this->connectDBServer){
                  die('Could not connect: ' . mysql_error()); ;
             }
           
             if(!$this->connectDB){
                  die('Could not connect: ' . mysql_error());
             }
            
             
       }
       
      //Disconnect to Database 
       public function DBDisconnect(){
           //End Databse Connection
            mysql_close($this->connectDBServer);
       }
       
       //View elements of Table in DB
       public function viewDB(){
           
       }
       
       //Insert element to DB
       public function addtoDB($addThis){
           
       }
       
       //Delete element in DB
       public function delete($deleteThis){
           
       }
       
       //Update element in DB
       public function updateDB($updateThis){
           
       }
       
       //Search for element in DB
       public function searchDB($searchThis){
           
       }

       //Get number of Elements in DB
       public function getCountInDB($string){
           
       }
                                          
        
    
    
}

?>
